Detecting and following terrain height autonomously along a flight path

ABSTRACT

A distance from an aerial vehicle to a terrain feature located forward and lower with respect to the aerial vehicle is measured. A current orientation of the aerial vehicle with respect to a reference orientation is detected. At least the measured distance and the current orientation is utilized to determine a relative vertical difference between a vertical location of the aerial vehicle and a vertical location of the terrain feature. The determined vertical difference is utilized to automatically adjust a flight altitude of the aerial vehicle.

BACKGROUND OF THE INVENTION

Harvesting crops manually is a labor-intensive activity, in particular,the application of pesticides/fertilizers. Due to public concern inregards to the release of chemicals into the environment and humanexposure to chemicals, the unmanned aerial vehicles (UAVs) may beutilized in aerial application of spray material (e.g., sprayingpesticide/fertilizer). Employing operators to remotely control UAVs,however, is labor-intensive and requires long periods ofhigh-concentration to attention.

For UAVs aiming to deliver pesticides/fertilizers directly to crops, animportant requirement is that they must be able to fly at low constantheights above the target crops to ensure efficiency, minimal waste, aswell as complete and even coverage. Flying too high above the cropresults in large amounts of pesticides/fertilizers being lost into theopen air. This not only poses a health and environmental hazard, butalso fails to deliver the necessary pesticides/fertilizers to the crops.On the other hand, flying too close to the crops limits the coverage ofthe spray, increases the danger of colliding with crops, and poses arisk to the UAVs should the terrain rise. Thus arises the need formaintaining the UAV at low fixed heights above the crops. In otherwords, it is desirable for the UAVs to be able to adapt to and followchanging terrain, whether it be elevation or obstacles, whilemaintaining a relatively constant height above the crops/ground. Suchcapability is important for UAVs to accurately deliverpesticides/fertilizers to crops planted in areas such as valleys, hills,and terraces.

BRIEF DESCRIPTION OF THE DRAWINGS

Various embodiments of the invention are disclosed in the followingdetailed description and the accompanying drawings.

FIG. 1 is a block diagram illustrating an embodiment of a heightestimation and control system.

FIG. 2 is a diagram illustrating an embodiment of a height estimationand control system onboard an aerial vehicle in flight.

FIG. 3 is a flowchart illustrating an embodiment of a process forestimating a relative height of a terrain feature.

FIG. 4 is a diagram illustrating an embodiment of determining height atthe look-forward distance based on two distance measurements.

FIG. 5 is a diagram illustrating an embodiment of using a plurality ofdifferent sensors to measure distance to terrain features.

FIG. 6 is a flowchart illustrating an embodiment of a process forestimating a relative height of a terrain feature at a look forwarddistance.

FIG. 7 is a diagram illustrating an embodiment of a height estimationsystem for building a profile of relative heights.

FIG. 8 is a diagram illustrating an example profile of relative heightsat interval horizontal distances.

FIG. 9 is a diagram illustrating an example change to the profile ofrelative heights at forward interval horizontal distances after verticalmovement of the UAV from the initial location shown in FIG. 8.

FIG. 10 is a diagram illustrating an example change to the profile ofrelative heights at forward interval horizontal distances afterhorizontal movement of the UAV from the location shown in FIG. 9.

FIG. 11 is a flowchart illustrating an embodiment of a process forbuilding and updating a profile of relative heights of terrain featureslocated in front of an aerial vehicle.

FIG. 12 is a flowchart illustrating an embodiment of at least a portionof a process of updating the relative height profile.

FIG. 13 is a diagram illustrating an example of FIG. 8 along with anillustration of a current distance measurement and its correspondingrelative height at its associated horizontal distance.

DETAILED DESCRIPTION

The invention can be implemented in numerous ways, including as aprocess; an apparatus; a system; a composition of matter; a computerprogram product embodied on a computer readable storage medium; and/or aprocessor, such as a processor configured to execute instructions storedon and/or provided by a memory coupled to the processor. In thisspecification, these implementations, or any other form that theinvention may take, may be referred to as techniques. In general, theorder of the steps of disclosed processes may be altered within thescope of the invention. Unless stated otherwise, a component such as aprocessor or a memory described as being configured to perform a taskmay be implemented as a general component that is temporarily configuredto perform the task at a given time or a specific component that ismanufactured to perform the task. As used herein, the term ‘processor’refers to one or more devices, circuits, and/or processing coresconfigured to process data, such as computer program instructions.

A detailed description of one or more embodiments of the invention isprovided below along with accompanying figures that illustrate theprinciples of the invention. The invention is described in connectionwith such embodiments, but the invention is not limited to anyembodiment. The scope of the invention is limited only by the claims andthe invention encompasses numerous alternatives, modifications andequivalents. Numerous specific details are set forth in the followingdescription in order to provide a thorough understanding of theinvention. These details are provided for the purpose of example and theinvention may be practiced according to the claims without some or allof these specific details. For the purpose of clarity, technicalmaterial that is known in the technical fields related to the inventionhas not been described in detail so that the invention is notunnecessarily obscured.

For high flying aircraft, altimeters are usually employed to determineelevation above sea level based on changing air pressures. This is oftenthe main method for which high flying aircraft avoid ground collisions.Because planes equipped with jet engines, such as commercial flights andcargo jets, have a cruising altitude of nearly 39,000 feet, they do notactively rely on terrain following technology. At very low altitudes,such as a few meters, altimeters lack the necessary accuracy to providereliable height readings to ensure height clearance and ground collisionavoidance. Moreover, the altimeters alone facilitate flights at fixedaltitudes, not fixed heights above the terrain.

A low flying aircraft may perform terrain following using terraindatabases. With the terrain database providing detailed elevation of theterrain, a low flying aircraft gets its current altitude from analtimeter and computes its height above the terrain by comparing itsaltitude with the elevation of the terrain beneath it. The onboardheight control system utilizes the computed height and controls theaircraft to maintain a desired height range. However, it is impracticalto rely on terrain databases for close-to-ground flights that requireUAVs positioned close above the crops. Not only is it prohibitivelycostly to build a terrain database that details variations less than 0.5meter, let alone less than 0.1 meter, the height of crops is in constantchange as they grow. For example, corn can grow to over 1.5 meters highand sorghum can grow even higher. The terrain database does not have thecapability to dynamically reflect crop heights. Thus, such technologiesusing altimeters and terrain databases are not typically suitable forflights that are only meters above the ground (e.g., in the case ofhigh-efficiency pesticide/fertilizer applications by UAVs).

Thus, in order to allow close-to-ground flight at meters (e.g., 1-3meters) above crops or ground/terrain, it is desirable to detect theUAV's current height above the crops/ground. This can be achieved usinga distance sensor, such as an ultrasonic sensor, to directly measure theUAV's height distance above only the ground directly beneath it. Suchmethods may be successful in collecting accurate height measurements,and the resulting height control may allow close-to-ground flight onflat terrain or terrain where elevation changes very slowly. However,such methods fail to provide crucial information on upcoming terrainchanges ahead of the UAV's path, especially in dealing with irregularterrains. Because changes in flight height/altitude cannot be achievedinstantaneously, it may take a considerable amount of time and traveldistance before a change to a desired flight height/altitude iscompleted for a fast moving UAV. Thus it is desirable to anticipatechanges in terrain to initiate flight maneuvers well ahead of changes interrain. For example, if the terrain (e.g., terraces) were to slopeupwards rapidly, the UAV may collide with the terrain if it does nothave sufficient time to adjust its height accordingly.

As a result, there exists a need for a novel height estimation andcontrol system that allows for safe, close-to-ground flights at metersabove the terrain/ground/crop/objects that can adapt to various varyingterrain. Such close-to-ground flights are important for applicationssuch as applying pesticide/fertilizer to crops, vegetables, andorchards.

Controlling an aerial vehicle is disclosed. In some embodiments, aheight estimation system is utilized by an aerial vehicle (e.g., UAV,drone, airplane, helicopter, or any other flying object) to conductclose-to-ground flights over hilly and/or unpredictable terrain. Forexample, when installed on a flying aircraft, this height estimationsystem provides estimates of the aircraft's height above ground, whichcan be used by a height control system to maintain the aerial vehicle atdesired heights in relation to varying terrain. Examples of terrainfeatures include ground materials, hills, plants, trees, crops,orchards, vineries, fences, bushes, trees, buildings, obstacles, snow,or any other object located on or near ground/terrain.

In some embodiments, a distance sensor is utilized to measure a distancefrom the aerial vehicle to a position on a terrain feature locatedforward and lower with respect to the aerial vehicle. For example, adistance from the aerial vehicle to a location on a terrain/groundbeneath and in front of the aerial vehicle is measured using a LightDetection and Ranging (LIDAR) sensor. A motion sensor (e.g., orientationsensor) is utilized to detect a current orientation of the aerialvehicle with respect to a reference orientation. For example, a pitchangle of the aerial vehicle is determined. At least the distance and thecurrent orientation are utilized to estimate a vertical differencebetween a vertical location of the aerial vehicle and a vertical heightlocation of the terrain feature forward and lower with respect to theaerial vehicle. For example, based on the geometric relationship of amounting angle of the distance sensor and the pitch angle of the aerialvehicle with respect to the measured distance, a relative verticalheight of the location of the terrain feature is calculated as anestimated relative height at the location. The estimated verticaldifference is utilized to automatically provide a flight control commandto adjust a flight height of the aerial vehicle. For example, a flightheight of the aerial vehicle is automatically adjusted to be lower orhigher (without requiring manual human operator control of verticalheight) to maintain a consistent height (e.g., within a range) when theaerial vehicle is flying over the object on the terrain/ground.

FIG. 1 is a block diagram illustrating an embodiment of a heightestimation and control system. Height estimation and control system 100may be utilized by an aerial vehicle that executes close-to-groundterrain-following flight. Examples of the aerial vehicle include a fixedwing aircraft, fixed wing drone, unmanned aerial vehicles (UAVs), or anyother flying object. The height estimation and control system 100comprises a distance sensor 12, a motion sensor 14, and a processingunit 16 (e.g., processor). The distance sensor 12 may include one ormore of the following: a LIDAR sensor, a radar sensor, an ultrasonicsensor, and any other sensor capable of measuring a distance. Motionsensor 14 may include one or more of the following: an inertialmeasurement unit, an accelerometer, a gyroscope, an orientation sensor,a magnetometer, a Global Positioning System (GPS) receiver, and anyother sensor able to measure an orientation, acceleration, position,specific force, angular rate, or magnetic field. The distance sensor 12is mounted on the UAV in such a way (e.g., positioned at a forward anddownward angle) so as to measure a distance to a position on a surfaceof a feature on the ground ahead of the UAV. As will be described withFIG. 2, this distance measurement together with measurements from themotion sensor 14 will be used to determine the UAV's relative heightabove a feature on ground (or terrain) ahead of the UAV.

The processing unit 16 is connected to both the distance sensor 12 andthe motion sensor 14 and receives measurement data from the distancesensor 12 and the motion sensor 14. Although only single instances ofdistance sensor 12 and the motion sensor 14 have been shown, any numberof distance sensor 12 and the motion sensor 14 may be connected toprocessing unit 16 in various embodiments. For example, processing unit16 receives a plurality of different measurements from differentdistance sensors and the different distance measurements are utilized toestimate relative heights for different terrain features simultaneously.The processing unit 16 further comprises a height estimation module 17and a height control module 20. The height estimation module 17estimates the UAV's relative height above a terrain feature (e.g., aheadof the UAV based on measurements from the distance sensor 12 and themotion sensor 14) and provides this height estimate to the heightcontrol module. Based on this relative height estimate, the heightcontrol module determines flight control commands (e.g., commands to themotors/engines), which in turn increase or decrease the correspondinglift to maintain the UAV at a desired relative height. By estimating therelative height of terrain features ahead of the UAV in the UAV's flightpath and controlling the UAV to maintain a relatively constant heightabove the terrain features as the UAV flies over the features, theheight estimation and control system 100 is capable of reacting inadvance to height changes of the upcoming terrain. Such capability toanticipate height changes is crucial as it provides the UAV time toadjust its height before reaching the upcoming terrain, thus allowingthe UAV to achieve safely close-to-ground terrain-following flight.

FIG. 2 is a diagram illustrating an embodiment of a height estimationand control system onboard an aerial vehicle in flight. In FIG. 2, theUAV 10 is shown midflight, traveling forward in the right-handdirection, over terrain 18. This terrain 18 outlines any terrain/groundfeatures including a wide variety of landscapes, flat ground, hills,plants, trees, crops, orchards, vineries, fences, bushes, trees,buildings, obstacles, etc. View 200 shows a side view of the UAV 10 andView 210 shows the front view of the UAV 10 (e.g., looking from thefront of the UAV). The x, y, and z axes shown are relative to the bodyof the UAV 10. As shown in view 200, the x-axis is pointing towards thefront of the UAV and the z-axis is pointing downward. When the UAV isviewed from the front as shown in view 210, the y-axis is pointingtowards the left of the UAV. The UAV pitch motion is around its y-axis,and the roll motion is around its x-axis. The angles θ and ψ correspondto the UAV's pitch angle and roll angle, respectively.

In the shown embodiment, the distance sensor 12 is mounted andpositioned on the UAV 10 so that the measured distance D_(f) is at apre-determined (e.g., fixed) forward-downward angle β with respect tothe UAV-relative axes. For example, the distance sensor 12 may include aLIDAR (radar or ultrasonic in other embodiments) sensor installed on theUAV 10 at the pre-determined forward-downward angle β with respect tothe UAV body-relative axes. In Euler angle convention, theforward-downward angle β is a negative value. As a result, the distanceD_(f) measured by the distance sensor 12 is between the UAV 10 and aposition P, which is on a feature of the ground 18 in front of thedrone's current horizontal position. Alternatively, the distance sensor12 may include a radar sensor or an ultrasonic sensor which is mountedon the UAV 10 at the pre-determined forward-downward angle β to providethe distance measurement D_(f).

The motion sensor 14 measures the pitch angle (θ) of the UAV 10. Themotion sensor 14 may comprise an inertial measurement unit (IMU), whichdirectly measures the acceleration of the UAV and determines the pitchangle of the UAV based on the acceleration measurements. Alternatively,the motion sensor 14 may comprise two Real Time Kinematic (RTK) GlobalPosition System (GPS) units and compute the pitch angle based on twoposition measurements from the two RTK GPS units. Both the distancesensor 12 and the motion sensor 14 are connected to the processing unit16, as shown in FIG. 2. The processing unit 16 receives measurementsfrom the at least two sensors and calculates the UAV's relative heightH_(f), above the terrain feature, based on the distance D_(f), the pitchangle θ, and the pre-determined forward-downward angle β.

FIG. 3 is a flowchart illustrating an embodiment of a process forestimating a relative height of a terrain feature. The process of FIG. 3may be executed by the processing unit 16, or more specifically, theheight estimation module 17 in the processing unit 16 in variousembodiments. The process of FIG. 3 may be repeated periodically and/ordynamically. Process 300 starts with receiving distance measurementD_(f) from a distance sensor and pitch angle θ from a motion sensor(e.g., sensor 14 of FIGS. 1 and 2) in step 302. In step 304, a relativeheight of a terrain feature relative to an aerial vehicle is determined.For example, the relative height is computed based on angular/geometricrelationships of the distance measurement with respect to the relativeheight of the terrain feature given the measured pitch angle θ and knownposition angle 3 of the distance sensor. Given the relationships shownin FIG. 2, relative height H_(f) of the terrain feature located atlocation point P can be calculated by: H_(f)=D_(f)*sin(|θ+β|).Optionally, the processing unit 16 may also compute horizontal forwarddistance L_(f) from a horizontal location of the aerial vehicle to thelocation of the terrain feature (e.g., from horizontal location of UAV10 to position P as represented in FIG. 2). The calculation for L_(f)may be calculated as follows: L_(f)=D_(f)*cos(|θ+β|).

It is worth noting that position P shown as an example on FIG. 2 is nota fixed position on the terrain/ground for every iteration of theprocess of FIG. 3. As the UAV flies forward, this position P moves, andit is ahead of the UAV by the forward distance L_(f). As shown in FIG.2, H_(f) is the relative height of the UAV above position P ahead of theUAV; that is, this relative height is the UAV's height above the terrainfeature located at position P on an upcoming flight path. Thus, thisrelative height contains information regarding the upcoming terrain. Forexample, if the terrain ahead is sloping up, the relative height valueH_(f) in front of the UAV at distance L_(f) will start decreasing if theUAV maintains the same flight altitude. In response to the changingrelative height value of the terrain features ahead of the UAV, the UAVmay be controlled to adjust its flight altitude to maintain a consistentrelative height as new H_(f) values are continually being calculated inthe flight path of the UAV. Thus, by controlling the UAV to maintain aconsistent height H_(f), the UAV will follow the terrain elevationchange. Such capability to respond to upcoming terrain elevation changesis critical for close-to-ground terrain following applications such asaerial applications (e.g., crop dustings).

In some embodiments, the motion sensor 14 may also measure and provide aroll angle ψ of the UAV (e.g., shown in FIG. 2). Given the roll angle ψ,determining the relative height includes calculating the relative heightH_(f) by performing the following calculation:H_(f)=D_(f)*cos(ψ)*sin(|θ+β|). Similarly, the forward distance L_(f) canbe computed as: L_(f)=D_(f)*cos(ψ)*cos(|θ+β|).

In some embodiments, the distance sensor 12 in FIG. 2 may include atleast two LIDAR (or radar, or ultrasonic) sensors each installed tomeasure distance from different angles. In the example of two distancesensor components/modules, two different pre-determined forward-downwardangles β₁ and β₂ (e.g., fixed preset installation angles) are utilizedby the distance sensor components. Thus, each sensor component providesits corresponding measurement of the distance from the UAV to a positionon the terrain feature in front of the UAV's current lateral position.The processing unit 16 receives the corresponding distance measurementsD_(f1) and D_(f2), corresponding to angles β₁ and β₂, and calculates thecorresponding H_(f1)=D_(f1)*sin(|θ+β₁|) and H_(f2)=D_(f)*sin(|θ+β₂|),and combines them to derive the UAV's relative height above terrainfeatures. In some embodiments, combining the distance measurementsincludes calculating a linear combination, e.g., H=(H_(f1)+H_(f2))/2.0.In some embodiments, combining the distance measurements includescalculating a weighted combination, e.g., H=a*Hn+(1−a)*H_(f2), where0≤a≤1. In some embodiments, combining the distance measurements includesselecting a smaller value among the distance measurements, e.g.,H=min(H_(f1), H_(f2)). In some embodiments, a look-forward distanceL_(x) may be selected and the relative height is estimated as the heightat the look-forward distance based on the plurality of distancemeasurements. FIG. 4 is a diagram illustrating an embodiment ofdetermining height H_(x) at the look-forward distance L_(x) based on thetwo distance measurements D_(f1) and D_(f2). For each distancemeasurement, the corresponding forward distance may be computed usingthe calculation: L_(f1)=D_(f1)*cos(|θ+β|) and L_(f2)=D_(f2)*cos(|θ+β₂|).Assuming |β₁|<|β₂|, L_(f1)>L_(f2). The height at the look-forwarddistance L_(x) may be estimated as:H=H _(x) =H _(f2)+(L _(x) −L _(f2))*(H _(f1) −H _(f2))/(L _(f1) −L_(f2)).Note that the resultant H_(x) is the relative height above P, which ison the line connecting P_(f1) and P_(f2) instead of on the terrainfeature outline 18. Therefore, H_(x) is an approximation of the actualheight at the look-forward distance L_(x).

Returning to FIG. 3, in step 306, the determined relative height isutilized to control a flight altitude. For example, a flight controlcommand to adjust a flight height/altitude of an aerial vehicle is sentbased on the determined relative height to maintain a consistent flightheight (e.g., within a range) over the terrain/ground features when theaerial vehicle is flying over the terrain/ground. By continuallyrepeating the process of FIG. 3 and adjusting the flight height of theaerial vehicle based on the determined relative height of ground/terrainfeatures detected in front of the aerial vehicle on its flight path, theaerial vehicle is able to automatically follow the vertical changes inground/terrain features to maintain a relatively consistent flightheight over the features of the ground/terrain. This may be useful whenspraying pesticides/fertilizers on crops planted on the ground/terrainusing a UAV to ensure efficient and safe application of thepesticide/fertilizer at a relatively consistent height over the cropswithout the need for an operator to constantly adjust the flight heightof the UAV manually.

In some embodiments, controlling the flight altitude includesdetermining an amount of altitude increase or decrease required tomaintain a consistent flight height over ground/terrain features. Forexample, a difference between a current relative height (e.g., distancebetween current vertical position of UAV and a terrain feature directlybelow the UAV) and the determined relative height (e.g., determined in304) to be utilized to control a flight altitude is calculated andutilized as the amount of altitude increase or decrease indicated in theflight control command (e.g., increase/decrease from current verticalaltitude) to lower (e.g., current relative height is less than thedetermined relative height) or raise (e.g., current relative height isgreater than the determined relative height) the flight height/altitudeof an aerial vehicle. In some embodiments, the distance between the UAVand a terrain feature beneath the UAV must be at least a configuredminimum distance and/or within a configured range and the controllingthe flight altitude includes providing an instruction to increase ordecrease a flight height/altitude of the aerial vehicle such that theminimum distance and/or within the range will be maintained whencontrolling the flight altitude.

FIG. 5 is a diagram illustrating an embodiment of using a plurality ofdifferent sensors to measure distance to terrain features. Distancesensor 52 shown in FIG. 5 includes an ultrasonic sensor in addition to aLIDAR or radar sensor. The ultrasonic sensor is installed facingdownward on UAV 10 towards the ground so as to measure a distance D_(d)from the UAV 10 to the ground directly under it. Because the ultrasonicsensor is facing directly downward, the distance D_(d) is H_(d) (theheight of the UAV 10 above the ground right under it). The processingunit 16 connected to the distance sensor 52 receives both theforward-downward distance measurement D_(f) and the distance measurementD_(d) from the ultrasonic sensor. It calculates H_(f) from D_(f) andintegrates H_(f) and H_(d) (H_(d)=D_(d)) to determine the height of theUAV 10 above the ground. The integration may be a linear combination,e.g., a simple averaging: H=(H_(f)+H_(d))/2.0 or a minimal value may beselected, e.g., H=min(H_(f), H_(d)).

In yet another further embodiment, the distance sensor includes anultrasonic sensor and at least one LIDAR (or radar) sensor and themotion sensor 14 further provides a forward velocity, v_(x), of the UAV10 in addition to the pitch angle θ. The ultrasonic sensor installed onthe UAV 10 faces downward and measures the distance D_(d) from the UAVto the ground directly under it. The LIDAR (or radar) sensor isinstalled at a pre-determined forward-downward angle β to measure adistance D_(f) to a position on the ground and in front of the UAV 10.The motion sensor 14 may comprise an IMU and a positioning system, suchas a Global Positioning System (GPS). The IMU directly measures theacceleration of the UAV and determines the pitch angle of the UAV basedon the acceleration measurements. In addition to the positionmeasurements, the GPS system provides the UAV position measurements aswell as the velocities and travel direction of the UAV. The motionsensor integrates the IMU measurements with the GPS position andvelocity measurements to provide the forward, lateral, and upwardvelocities of the UAV. The processing unit 16 receives the distancemeasurements from the distance sensor, the pitch angle and forwardvelocity from the motion sensor, and determines the UAV's relativeheight over terrain features.

FIG. 6 is a flowchart illustrating an embodiment of a process forestimating a relative height of a terrain feature at a look-forwarddistance. The process of FIG. 6 may be executed by the processing unit16, or more specifically, the height estimation module 17 in theprocessing unit 16 in various embodiments. The process of FIG. 6 may berepeated periodically and/or dynamically. Process 600 starts withreceiving the measurements from the distance sensor 52 and the motionsensor 14 in step 602.

In step 604, the process computes relative height and forward distancefor each distance measurement. For example, for the measurement from theultrasonic sensor, H_(d)=D_(d) and the forward distance L_(d)=0; for themeasurements from the distance sensor, H_(f)=D_(f)*sin(|θ+β|) and theforward distance L_(f)=D_(f)*cos(|θ+β|). Subsequently in step 606, alook-forward distance L_(x) is determined based on the forward velocityv_(x). For example, the look-forward distance L_(x) can be computed as:L_(x)=T_(x)*v_(x), where T_(x) is a pre-defined look-forward time. Thelook-forward distance L_(x) identifies the amount of horizontal forwarddistance from the aerial vehicle where a relative height of a terrainfeature is desired to be determined to allow the aerial vehicle toadjust its flight height relative to the height of the terrain featurelocated at or within L_(x). Given the variance in amount of distance andtravel required to change the flight height due to different vehiclespeeds, by basing L_(x) on the forward velocity of the aerial vehicle,L_(x) becomes larger with increased velocity and smaller with decreasedvelocity. The look-forward time T_(x) may be determined based oncharacteristics of the aerial vehicle (e.g., weight, design, model,application, attached accessories, etc.), flight control system (e.g.,type, version, etc.), environmental factors, and/or user configuration.For example, if the UAV is agile (the UAV's flight control isresponsive), the look-forward time T_(x) may be smaller since the UAVcan raise or lower itself in a relatively short time. On the other hand,if the UAV's response is slow, the look-forward time T_(x) may be largersince it takes more time for the UAV to raise or lower itself. Exemplaryvalues for T_(x) can range from 0.5 seconds to 3 seconds. Alternatively,in some embodiments, look-forward distance L_(x) is bounded by a minimumvalue L_(min), e.g., L_(x)=max (T_(x)*V_(x), L_(min)). For example, ifthe forward speed is small, L_(x) is set as the minimum value L_(min).

In step 608, the relative height at the look-forward distance isestimated. For example, the relative height of the terrain feature atthe look-forward distance is calculated based on the look-forwarddistance L_(x), the calculated heights (e.g., H_(f) and H_(d)), andforward distances (e.g., L_(f) and L_(d)). In some embodiments, linearinterpolation of the H_(f) and L_(f) pair and the H_(d) and L_(d) pairis calculated to determine H_(x);H_(x)=H_(d)+(L_(x)−L_(d))*(H_(f)−H_(d))/(L_(f)−L_(d)) when(L_(f)−L_(d))≠0; in case (L_(f)−L_(d))=0, simple averaging may be used:Hx=(H_(f)+H_(d))/2. In example shown in FIG. 4,H_(x)=H_(f2)+(L_(x)−L_(f2))*(H_(f1)−H_(f2))/(L_(f1)−L_(f2)).

In step 610, a relative height estimate to be utilized for flightcontrol is selected. For example, the relative height determined in 608is utilized as one of a plurality of possible relative height estimatechoices. For example among H_(x) and H_(d), a minimum value is selectedsuch that H=min(H_(x), H_(d)).

Thus, the UAV's relative height estimate to be utilized for flightcontrol within the look-forward distance L_(x) from the horizontallocation of the aerial vehicle may be selected as the minimum relativeheight estimate among the choices for distances within the look-forwarddistance L_(x) from the horizontal location of the aerial vehicle. Usinga smaller relative height estimate will cause the aerial vehicle to flyhigher (e.g., to compensate for the larger terrain feature height thatcaused the relative height estimate to be smaller), ensuring a saferflight at a higher flight height.

In step 612, the selected relative height is utilized to control flightaltitude. For example, a flight control command to adjust a flightheight/altitude of the aerial vehicle is sent based on the determinedrelative height to maintain a consistent flight height (e.g., within arange) over the terrain/ground features when the aerial vehicle isflying over the terrain/ground. In some embodiments, controlling theflight altitude includes determining an amount of altitude increase ordecrease required to maintain a consistent flight height overground/terrain features. For example, a difference between a currentrelative height (e.g., distance between current vertical position of UAVand a terrain feature directly below the UAV) and the selected relativeheight (e.g., selected in 610) to be utilized to control a flightaltitude is calculated and utilized as the amount of altitude increaseor decrease indicated in the flight control command (e.g.,increase/decrease from current vertical altitude) to lower (e.g.,current relative height is less than the selected relative height) orraise (e.g., current relative height is greater than the selectedrelative height) the flight height/altitude of an aerial vehicle. Insome embodiments, the distance between the UAV and a terrain featurebeneath the UAV must be at least a configured minimum distance and/orwithin a configured range and the controlling the flight altitudeincludes providing an instruction to increase or decrease a flightheight/altitude of the aerial vehicle such that at least the minimumdistance and/or the range will be maintained when controlling the flightaltitude.

FIG. 7 is a diagram illustrating an embodiment of a height estimationsystem for building a profile of relative heights. The height estimationsystem comprises a distance sensor 72, a motion sensor 74, and aprocessing unit 76. The distance sensor 72 may comprise a LIDAR or radaror ultrasonic sensor, which is installed at a pre-determinedforward-downward angle β with respect to the axes of the UAV 10.Distance sensor 72 measures a distance D_(f) between the UAV 10 and aposition P_(f) ahead of the UAV of a feature on the terrain featureoutline 18. The motion sensor 74 may comprise an IMU and a positioningsystem such as a GPS to detect the pitch angle (θ) of the UAV, theposition of the UAV including its altitude, and the traveling speed ofthe UAV. The processing unit 76 is connected to both the distance sensor72 and the motion sensor 74. It receives the measurements of the sensorsand builds a profile of relative height difference between the verticalheight of the UAV and the vertical height of terrain features.

FIG. 8 is a diagram illustrating an example profile of relative heightsat interval horizontal distances. For example, the profile of relativeheights is utilized by the UAV 10 as it is flying over a terrain 18 at atime instance t₀. The relative height profile consists of a set ofrelative height values, h₀, h₁, h₂, . . . , each of which corresponds toa difference between UAV's current height and a height of a ground (orterrain) feature at the associated location ahead of the UAV. In someembodiments, the relative height profile is represented as an array,(e.g., hProfile array) and its length can be fixed or varying. Therelative height profile shown in FIG. 8 has a length of N=10, and itsvalues are hProfile=[h₀, h₁, h₂, . . . h₉].

As illustrated, h₀ is the current height of the UAV in relation to P₀,the terrain feature directly beneath it; h₁ is the UAV's height distanceabove P₁, the terrain feature at a distance DX ahead of the horizontallocation of the UAV, h₂ is the UAV's height distance above P₂, theterrain feature at a further distance ahead of the horizontal locationof the UAV, and so on. For example, hProfile(t₀)=[5, 6, 8, 9, 10 . . . ]means that the UAV is 5 m above P₀, 6 m above P₁, 8 m above P₂, etc. Thehorizontal spacing/distance between the terrain feature positions (P₀,P₁, P₂, etc.) does not have to be constant and can vary betweendifferent feature positions. For simplicity of the description, thepositions are equally spaced with pre-determined distances DX.Therefore, the distance between any terrain feature position point P_(i)and the UAV's current ground position P₀ is equal to i*DX.

FIG. 9 is a diagram illustrating an example change to the profile ofrelative heights at forward interval horizontal distances after verticalmovement of the UAV from the initial location shown in FIG. 8. Forexample, FIG. 8 shows the position of the UAV 10 at time instance t₀ andFIG. 9 shows the position of the UAV 10 at a subsequent time instance t₁when the UAV is still on top of position P₀ but has changed in altitudeby dh. Because the motion sensor 74 provides altitude measurements, thischange in altitude can be detected by comparing the altitude measurement(provided by motion sensor 74) at time to with the altitude measurementat time t₁. When a new altitude measurement is detected, the UAV 10modifies each element of its profile of relative heights (e.g., elementsof hProfile) accordingly. The relative height above each position can beupdated as h_(i)(t₁)=h_(i)(t₀)+dh. For example, hProfile(t₁)={h₀(t₀)+dh,h₁(t₀)+dh, h₂(t₀)+dh, h₃(t₀)+dh, . . . , h₉(t₀)+dh}. Thus, if dh(t₁)=2mand hProfile(t₀)=[5, 6, 8, 9, 10 . . . ], hProfile(t₁) ishProfile(t ₁)=hProfile(t ₀)+dh(t ₁)=[5+2,6+2,8+2,9+2,10+2 . . .]=[7,8,10,11,12, . . . ].

Similarly, if from time instance t₁ to time instance t₂, the UAV 10 isstill hovering on top of position P₀, but drops in altitude bydh(t₂)=−3m, the new relative height profile would be:hProfile(t ₂)=hProfile(t ₁)+dh(t ₂)=[7−3,8−3,10−3,11−3,12−3, . . .]=[4,5,7,8,9, . . . ].

For simplicity, we are assuming that the UAV is not moving horizontally,and is only moving in the vertical direction. Hence, we can derive thefollowing equation if the UAV only changes in altitude between two timeinstances:hProfile(t _(k+1))=hProfile(t _(k))+dh(t _(k+1)), where dh(t_(k+1))=altitude(t _(k+1))−altitude(t _(k)).

FIG. 10 is a diagram illustrating an example change to the profile ofrelative heights at forward interval horizontal distances afterhorizontal movement of the UAV from the location shown in FIG. 9. Forexample, FIG. 9 shows the position of the UAV 10 at time instance t₁ andFIG. 10 shows the position of the UAV 10 at a third time instance t₃.From time instance t₂ shown in FIG. 9 to time instance t₃ shown in FIG.10, the UAV travelled a distance dx without a change in altitude.Assuming the travel distance dx is twice of DX (i.e., dx=2*DX) asillustrated in FIG. 10, the UAV is now over terrain feature position P₂.Because the first element h₀(t₃) in the relative height profile arrayhProfile(t₃) represents the relative height of the UAV 10 in relation tothe terrain feature directly beneath it, h₀(t₃) now represents the UAV'sheight above P₂. Therefore, h₀(t₃)=h₂(t₂).

Similarly, the second element h₁(t₃) of the relative height profilearray hProfile(t₃) represents the UAV's height above P₃, a position atDX ahead of the UAV, h₁(t₃)=h₃(t₂). Given that previously at timeinstance t₂ the UAV 10 had the following relative height profile (aspreviously discussed with FIG. 9):hProfile(t ₂)=[h ₀(t ₂),h ₁(t ₂),h ₂(t ₂), . . . ]=[4,5,7,8,9, . . . ],the updated relative height profile at time instance t₃ would be asfollows:hProfile(t ₃)=[h ₀(t ₃),h ₁(t ₃),h ₂(t ₃), . . . ]=[h ₂(t ₂),h ₃(t ₂),h₄(t ₂), . . . ]=[7,8,9, . . . ].

That is, hProfile(t₃)=hProfile(t₂)<<n, where the operating symbol “<<”means shifting the elements of an array to the left, n is the shiftnumber, and “<<n” represents shifting the elements by n elements. Inthis particular case, the shift number n=floor(dx/DX)=2, meaningshifting the elements of hProfile(t₂) left by two elements. (Functionfloor(a) is to get the integer part of a.) For cases where the UAV istraveling backwards instead of forwards, dx is negative and the relativeheight profile array should instead shift to the right:hProfile(t₃)=hProfile(t₂)>>n, where n=floor(|dx|/DX) and “>>” representsshifting the elements of an array to the right.

Thus, the profile of relative heights at various distances away from theaerial vehicle may be updated based on the distance traveled by theaerial vehicle. For example, the relative height profile array (e.g.,hProfile) may be updated by a shifting of the existing elements in thearray. Because h₀ of the profile should always represent the height ofthe UAV in relation to the ground position directly beneath it, theelements of relative height profile will shift left as the UAV movesforward. Because updating the profile based on travel distance does notadd new elements to the profile, the length of the profile will changeeach time it is updated. For simplicity, FIG. 10 and related descriptionassumed that DX is constant (e.g., the distance between any two adjacentposition points corresponding to the profile is equal). However, invarious embodiments, the horizontal distance between any two adjacentelements in the profile of relative heights at various distances mayvary across different adjacent elements.

In these embodiments, the profile array will only shift over an elementwhen the aerial vehicle has traveled past the horizontal distancerepresented by the element. In other words, if the UAV is halfwaybetween P₅ and P₆, the profile array elements of hProfile will stillaccount for any altitude change, but the profile array elements will notbe shifted until the UAV reaches a horizontal distance corresponding toP₆.

Hence, we can derive the following equation if, from time instance t_(k)to time instance t_(k+1), the UAV travelled forward by a distance of dx(dx>=0) without changing its altitude:hProfile(t _(k+1))=hProfile(t _(k))<<n, where n=floor(dx/DX).

After this update, the travel distance dx should be reset to bedx=dx−n*DX to prepare for the next time instance.

More realistically, as the UAV is flying, both its vertical andhorizontal positions change for a next time interval, and the processingunit 76 updates the profile of relative heights by concurrently updatingfor the next time interval relative height values corresponding to thevertical position change and shifting any profile elements based on thehorizontal position change. Furthermore, as new relative distancemeasurements are obtained from the distance sensor 72, the processingunit 76 further incorporates the new distance measurements to update theprofile of relative heights, an embodiment of which will be furtherdescribed along with FIG. 11.

FIG. 11 is a flowchart illustrating an embodiment of a process forbuilding and updating a profile of relative heights of terrain featureslocated in front of an aerial vehicle. The process of FIG. 11 may beexecuted by the processing unit 16, or more specifically, the heightestimation module 17 in the processing unit 16 in the variousembodiments. The process of FIG. 11 may be repeated periodically and/ordynamically. For example, each iteration of the process of FIG. 11 is aprocessing cycle and time t_(k) is incremented after each iteration.Process 1100 starts at 1102 by receiving the distance measurements fromthe distance sensor 72 and the pitch angle θ, the forward speed v_(x),and the altitude measurements from the motion sensor 74.

Subsequently in step 1104, each relative height at its associatedhorizontal forward distance is determined using the receivedmeasurements. As described with FIG. 2, the height H_(f) and the forwarddistance L_(f) are calculated as follows: H_(f)=D_(f)*sin(|θ+β|) andL=D_(f)*cos(|θ+β|), where θ is the pitch angle from the motion sensor 74and β is the pre-determined forward-downward angle for installing theLIDAR or radar sensor.

In step 1106, the travel distance and altitude change of the aerialvehicle are determined. In some embodiments, the travel distancedx(t_(k)) is computed based on the forward velocity v_(x) detected bythe motion sensor 74. For example dx(t_(k))=dx(t_(k−1))+vx*dt, where dtis the time difference between two processing cycles. If process 1100 isexecuted in cycles at 100 Hz, then the time difference dt is 0.01second. The altitude change is calculated by comparing the currentaltitude measurement from the motion sensor 74 with the previousaltitude measurement (e.g.,dh(t_(k))=altitude(t_(k))−altitude(t_(k−1))).

In step 1108, the determined altitude change (e.g., dh(t_(k))) andhorizontal travel distance (e.g., dx(t_(k))) are utilized to update theprofile of relative heights. As previously described with FIG. 9 andFIG. 10, the profile of relative heights may be updated with thealtitude by using the following:hProfile(t _(k))=hProfile(t _(k−1))+dh(t _(k)), where dh(t_(k))=altitude(t _(k))−altitude(t _(k−1))

In some embodiments, the profile of relative heights is shiftedaccording to the travel distance dx(t_(k)). For example, after updatingthe relative height profile, the travel distance dx(t_(k)) is utilizedto remove/shift from the profile, entries corresponding to the amount ofhorizontal travel and the horizontal travel distance is reset.

If dx(t_(k))>=0, the profile shifts left:hProfile(t _(k))=hProfile(t _(k))<<n(t _(k)), where the shift number n(t_(k))=floor(dx(t _(k))/DX),and the horizontal travel distance is reset as follows:dx(t_(k))=dx(t_(k))−n(t_(k))*DX.

If dx(t_(k))<0, the profile is shifted right:hProfile(t _(k))=hProfile(t _(k))>>n(t _(k)), where the shift number n(t_(k))=floor(|dx(t _(k))|/DX),and the horizontal travel distance is reset as follows:dx(t_(k))=dx(t_(k))+n(t_(k))*DX.

In the case where the shift number n(t_(k))=0, the relative heightprofile is not shifted.

In step 1110, the relative height profile is updated based on eachrelative height and its associated horizontal distance determined instep 1104. FIG. 12 is a flowchart illustrating an embodiment of at leasta portion of a process of updating the relative height profile. Theprocess of FIG. 12 may be performed in step 1110 of FIG. 11. To assistin the description of step 1110 (e.g., how each H and L are used toupdate the relative height profile) and process 1200, FIG. 13 is adiagram illustrating an example of the UAV at the same third timeinstance t₃ as the time instance for FIG. 8 with the addition of theillustration of a current distance measurement D_(f) from the distancesensor together with its corresponding relative height at its associatedhorizontal distance determined in step 1104. The process of FIG. 12 maybe executed by the processing unit 16, or more specifically, the heightestimation module 17 in the processing unit 16 of the variousembodiments. Process 1200 starts at step 1202 with determining theelement index of the relative height profile corresponding to the newrelative height H_(f). The determination is based on the forwarddistance L_(f): i=floor(L_(f)/DX), where i is the corresponding elementindex. In the example shown in FIG. 13, 8*DX<L_(f)<9*DX, therefore, thecorresponding element index i=floor(L_(f)/DX)=8. In step 1204, theprocessing unit 76 then checks if the relative height profile alreadyhas values for that element index. One example way is to check thecorresponding element index i with the length of the relative heightprofile.

If length(hProfile(t_(k)))>i, the relative height profile already has anh_(i). The process 1200 continues to step 1206 to integrate the existingheight element h_(i) with the new height H_(f). For example, theintegration may be a simple linear combination:h_(i)=a*h_(i)+(1−a)*H_(f), where 0≤a≤1.

Otherwise (i.e., length(hProfile(t_(k)))<=i), the existing relativeheight profile hProfile(t_(k)) does not have element h_(i). (Note thatthe element index i starts at 0; therefore, if the length of a relativeheight profile is N, it has elements with index from 0 to (N−1).) Theprocess 1200 further checks whether length(hProfile(t_(k)))==i in step1208. If length(hProfile(t_(k)))==i, the relative height profile doesnot have an element corresponding to element index i but has an elementcorresponding to element index (i−1), which is adjacent to element indexi. Thus, the process 1200 continues to step 1210 to add the new heightH_(f) as the last element h_(i). As a result, the length of the relativeheight profile is increased by 1.

If length(hProfile(t_(k)))<i, the relative height profile not only lacksan element corresponding to element index i but also lacks elementsadjacent to the element index i. The process 1200 continues to step 1212to add the new height H_(f) as the element h_(i) and also fills in theelements between the current last element of the hProfile(t_(k)) and theelement h_(i). In one embodiment, the process 1200 fills in theseelements equally with the new relative height H_(f). In anotherembodiment, the process 1200 fills in these elements by linearinterpolating the new relative height and the existing last element ofthe relative height profile. Denoting N=length(hProfile(t_(k))), and thecurrent last element is h_((N-1)), for each element between h_((N-1))and h_(i), its value based on linear interpolation may be derived asfollows: h_(j)=h_((N-1))+h_(i)*(j−(N−1))/(i−(N−1)), where N≤j≤i.

After updating the relative height profile with a new relative heightvalue H_(f), in one of the steps 1206, 1210, or 1212, the process 1200exits and the process continues from step 1110 to 1112. In furtherembodiments where the distance sensor (e.g., sensor 72) includes morethan one sensor component (e.g., multiple LIDAR sensors), there is morethan one set of relative height and its associated horizontal distancepair (e.g., H_(f), L_(f)) to process. The process 1200 may check ifthere are more relative heights and distance pairs (H_(f), L_(f)) toprocess before it ends. If there are more relative heights and distancepairs to process, the process 1200 goes back to step 1202 to update therelative height profile with the next relative heights and distance pair(H_(f), L_(f)) until there are no more relative heights and distancepairs (H_(f), L_(f)) to process.

Returning to FIG. 11, in step 1112 a relative height to be utilized tocontrol flight altitude is determined. For example, the relative heightto be utilized is determined based on the relative height profilehProfile(t_(k)) updated in 1110. In one embodiment, the processing unit76 may choose the smallest relative height in the relative heightprofile as the relative height to be utilized to control flightaltitude: h_(final)(t_(k))=min(hProfile(t_(k))). In some embodiments,the processing unit 76 may determine a look-forward distance L_(x) andchoose the smallest relative height within the look-forward distanceL_(x). The look-forward distance L_(x) may be determined based on theforward velocity v_(x) from the motion sensor 74, e.g.,L_(x)=T_(x)*v_(x) or L_(x)=max(L_(min), T_(x)*v_(x)), where T_(x) is apre-determined look-forward time and L_(min) is a pre-determined minimumlook-forward distance. The pre-determined look-forward time T_(x) may bedetermined with consideration of the flight characteristics of the UAV.A shorter T_(x) may be selected if the UAV is agile and a longer T_(x)may be selected if the UAV responds slowly.

To determine the smallest relative height within the look-forwarddistance, the smallest element index whose corresponding position isahead of L is determined as I_(x)=ceil(L_(x)/DX), where function ceil(a)is the smallest integer that is greater than a. For example, ifL_(x)=3.2*DX, then I_(x)=ceil(3.2)=4. The smallest relative heightwithin the look-forward distance is then determined as the smallestheight among the first I_(x) elements of the relative height profile.

In a further embodiment, the distance sensor (e.g., sensor 72) mayinclude at least two separate sensor modules (e.g., two different LIDARsensors) installed at two different pre-determined forward-downwardangles β₁ and β₂. Each sensor module may provide a measurement of thedistance from the UAV to a position on the terrain feature in front ofthe UAV. The processing unit 76 may receive both distance measurementsD_(f1) and D_(f2) at step 1102, and calculate the correspondingH_(f1)=D_(f1)*sin(|θ+β₁|), H_(f2)=D_(f2)*sin(|θ+β₂|) as well asL_(f1)=D_(f1)*cos(|θ+β₁|), L_(f2)=D_(f2)*cos(|θ+β₂|) at step 1104. Atstep 1110, the processing unit 76 may update the relative height profilewith the relative height information from both sensor modules. In oneembodiment, each H_(fi) is treated independently and the relative heightprofile is updated with each of them sequentially using the process 1200of FIG. 12. The sequence of the update may be related to thepre-determined forward-downward angles β_(i). For example, the relativeheight profile is first updated with the H_(fi) from the sensorinstalled with the largest |β_(i)| and continues to the H_(fi) from thesensor with a smaller |β_(i)|. Since a sensor module configured with alarger |β_(i)| looks closer than a sensor module with a smaller |β_(i)|(that is, L_(fi)<L_(fj) if |β_(i)|>|β_(j)|), the relative height profileis therefore first updated with H_(fi) from sensor modules that lookcloser in distance and then updated with H_(fi) from sensor modules thatlook further away. In another embodiment, linear interpolation isapplied to generate a corresponding relative height for relative heightprofile elements in between two adjacent forward distances L_(f1) andL_(f2); these elements are also updated with the generated correspondingrelative height.

In some embodiments, the distance sensor 72 may include at least oneLIDAR (or radar) sensor installed at a pre-determined forward-downwardangle β and an ultrasonic (or radar) sensor facing directly downward. Instep 1102, the processing unit 76 may receive both the forward-downwarddistance D_(f) from the LIDAR (or radar) sensor module and the downwarddistance D_(d) from the ultrasonic (or radar) sensor module. In step1104, it calculates H_(f)=D_(f)*sin(|θ+β|), L_(f)=D_(f)*cos(|θ+β|), andH_(d)=D_(d). Because the ultrasonic sensor module is looking downdirectly, it may be assumed that L_(d)=0. In step 1110, the processingunit 76 may update the relative height profile with H_(f) and H_(d) aspreviously described in conjunction with FIG. 11. Note that becauseL_(d)=0, H_(d) is used to update the first element of the relativeheight profile.

In another embodiment, the distance sensor 72 may include a scanningLIDAR (or radar) sensor that sweeps through a range of forward-downwardangles and provides an array of distance measurements [D_(f1), D_(f2), .. . , D_(fn)] at forward-downward angles [β₁, β₂, . . . , β_(n)](|β₁|>|β₂|> . . . >|β_(n)|). Accordingly, the processing unit 76receives this array of measurements (and the array of forward-downwardangles if the angles are not fixed or pre-determined) in step 902; itthen computes arrays of H_(f) and L_(f) as follows:H _(f) H _(f1) ,H _(f2) , . . . ,H _(fn)], where H _(fi) =D_(fi)*sin(|θ+β_(i)|), andL _(f) L _(f1) ,L _(f2) , . . . ,L _(fn)], where L _(fi) =D_(fi)*cos(|θ+β_(i)|).

Note that since (|β₁|>|β₂|> . . . >|β_(n)|), L_(f1)<L_(f2)< . . .<L_(fn).

In some embodiments, after the processing unit 76 determines the traveldistance and altitude change in step 1106 and updates the relativeheight profile based on the travel distance and altitude change in step1108, the relative height profile is updated based on the arrays ofH_(f) and L_(f). The relative height profile may be updated using eachH_(fi) one by one as previously described. In some embodiments, linearinterpolation is performed to generate relative height values forelements in the relative height profile that do not have a correspondingH_(fi). For example, if L_(f2) corresponds to the fourth element of therelative height profile and L_(f3) corresponds to the sixth element,there is no H_(fi) to update the fifth element. The processing unit 76may compute a height value using linear interpolation of H_(f2) andH_(f3) to update the fifth element as well. Thus, by using linearinterpolation, all height elements between forward distance L_(f1) andL_(fn) can be updated.

In some embodiments, the relative height profile (e.g., hProfile(t_(k)))may have an associated confidence array (e.g., hConf(t_(k))), where eachelement in the confidence array indicates the confidence level of itscorresponding element in the relative height profile. That is, forhProfile(t_(k))=[h₀(t_(k)), h₁(t_(k)), h₂(t_(k)), . . . ], theconfidence array is hConf(t_(k))=[c₀(t_(k)), c₁(t_(k)), c₂(t_(k)), . . .], where c₀(t_(k)) is the confidence level for h₀(t_(k)), c₁(t_(k)) isthe confidence level for h₁(t_(k)), and so on. In some embodiments, eachelement in the confidence array may be a value between 0 and 1, where 0indicates no confidence while 1 indicates the highest confidence.

The confidence array may be updated along with the relative heightprofile in steps 1108 and 1110, and then in step 1112, the relativeheight is determined based on both the relative height profilehProfile(t_(k)) and the confidence array hConf(t_(k)). In oneembodiment, in step 1108, as the relative height profile is updatedbased on the travel distance and altitude change, the confidence levelsmay be reduced to account for increased uncertainties as time lapsesand/or UAV moves. Subsequently in step 1110, as the relative heightprofile hProfile(t_(k)) is updated based on each H_(f) and L_(f), theconfidence array hConf(t_(k)) is updated along with C_(f), theconfidence level of each H_(f). The confidence level C_(f) may be apre-defined value or it may be determined based on the characteristics(such as consistency and/or signal-to-noise ratio) of the measurementsfrom the distance sensor.

In some embodiments in step 1112, the determination of the relativeheight may be based on both the relative height profile and theconfidence array. In one embodiment, the processing unit 76 may choosethe smallest height among height elements that have confidence levelsabove a pre-defined threshold. For example, if in the confidence arrayhConf(t_(k)) only the confidence levels c_(j1)(t_(k)), c_(j2)(t_(k)),c_(j3)(t_(k)), c_(j4)(t_(k)) are greater than the pre-defined threshold,then h_(final)(t_(k))=min(h_(j1)(t_(k)), h_(j2)(t_(k)), h_(j3)(t_(k)),h_(j4)(t_(k))). If there is no confidence level greater than thepre-defined threshold, the relative height element that has the minimumvalue may be selected as the relative height to be utilized for flightaltitude control and its associated confidence level is also outputted.In embodiments where a look-forward distance L is determined, therelative height to be utilized for flight altitude control is determinedto be the smallest height among height elements within the look-forwarddistance L and whose confidence levels are above a pre-definedthreshold.

In step 1114, the determined relative height is utilized to controlflight altitude. For example, a flight control command to adjust aflight height/altitude of the aerial vehicle is sent based on thedetermined relative height to maintain a consistent flight height (e.g.,within a range) over the terrain/ground features when the aerial vehicleis flying over the terrain/ground. In some embodiments, controlling theflight altitude includes determining an amount of altitude increase ordecrease required to maintain a consistent flight height overground/terrain features. For example, a difference between a currentrelative height (e.g., distance between current vertical position of UAVand a terrain feature directly below the UAV) and the determinedrelative height (e.g., determined in 1112) to be utilized to control aflight altitude is calculated and utilized as the amount of altitudeincrease or decrease indicated in the flight control command (e.g.,increase/decrease from current vertical altitude) to lower (e.g.,current relative height is less than the determined relative height) orraise (e.g., current relative height is greater than the determinedrelative height) the flight height/altitude of an aerial vehicle. Insome embodiments, the distance between the UAV and a terrain featurebeneath the UAV must be at least a configured minimum distance and/orwithin a configured range and the controlling the flight altitudeincludes providing an instruction to increase or decrease a flightheight/altitude of the aerial vehicle such that at least the minimumdistance and/or the range will be maintained when controlling the flightaltitude.

Although the foregoing embodiments have been described in some detailfor purposes of clarity of understanding, the invention is not limitedto the details provided. There are many alternative ways of implementingthe invention. The disclosed embodiments are illustrative and notrestrictive.

What is claimed is:
 1. A system for controlling an aerial vehicle,comprising: a distance sensor configured to measure a distance from theaerial vehicle to a terrain feature located forward and lower withrespect to the aerial vehicle; a motion sensor configured to detect acurrent orientation of the aerial vehicle with respect to a referenceorientation, wherein the current orientation includes a currentorientation angle; and a processor in communication with the distancesensor and the motion sensor and configured to: use at least themeasured distance, a forward-downward positioning angle of the distancesensor, and the current orientation including the current orientationangle detected using the motion sensor to determine a relative verticaldifference between a vertical location of the aerial vehicle and avertical location of the terrain feature, including by using theforward-downward positioning angle of the distance sensor together withthe current orientation angle detected using the motion sensor todetermine a total angle of the measured distance with respect to ahorizontal plane; and use the determined vertical difference toautomatically adjust a flight altitude of the aerial vehicle.
 2. Thesystem of claim 1, wherein determining the relative vertical differenceincludes calculating the relative vertical difference using a geometricrelationship between the measured distance and the relative verticaldifference based on an angular relationship defined at least in part bythe detected current orientation.
 3. The system of claim 1, wherein theprocessor is further configured to calculate a horizontal distance fromthe aerial vehicle to the terrain feature using at least the measureddistance and the current orientation, including by determining ahorizontal distance component of the measured distance based on thetotal angle determined using the forward-downward positioning angle ofthe distance sensor and the current orientation angle detected using themotion sensor.
 4. The system of claim 1, wherein the flight altitude ofthe aerial vehicle is automatically adjusted during aerial applicationof a spray product.
 5. The system of claim 1, wherein the automaticadjustment of the flight altitude of the aerial vehicle is one of aplurality of automatic flight altitude adjustments made to verticallyfollow heights of terrain features in a flight path of the aerialvehicle.
 6. The system of claim 1, wherein the distance sensor iscoupled on the aerial vehicle at the forward-downward angle with respectto the aerial vehicle.
 7. The system of claim 1, wherein the distancesensor comprises at least one of the following: a LIDAR sensor, a radarsensor, or an ultrasonic sensor.
 8. The system of claim 1, wherein thedistance sensor includes a plurality of different sensors configured atdifferent measurement angles.
 9. The system of claim 1, furthercomprising an ultrasonic sensor configured to measure a distance toanother terrain feature located directly under the aerial vehicle. 10.The system of claim 1, wherein the motion sensor detects a velocity ofthe aerial vehicle and the velocity of the aerial vehicle is utilized todetermine a look-forward distance associated with the determinedrelative vertical difference.
 11. The system of claim 10, wherein thelook-forward distance is calculated at least in part by multiplying thevelocity with a specified time value.
 12. The system of claim 1, whereinthe motion sensor includes one or more of the following: an inertialmeasurement unit or a global positioning system receiver.
 13. The systemof claim 1, wherein the relative vertical difference is determined toupdate a relative height profile, and the relative height profileincludes relative height values of terrain features located at variousdistances away from the aerial vehicle.
 14. The system of claim 13,wherein updating the relative height profile includes determining anelement index of the relative height profile corresponding to thedetermined relative vertical difference and comparing the determinedelement index with a length of the relative height profile.
 15. Thesystem of claim 13, wherein updating the relative height profileincludes: identifying an element of the relative height profilecorresponding to the determined relative vertical difference andupdating the element, or adding the determined relative verticaldifference to the relative height profile.
 16. The system of claim 13,wherein the relative height profile is modified based on an altitudechange of the aerial vehicle including by adding a value indicating thealtitude change to one or more entries of the relative height profile.17. The system of claim 13, wherein the relative height profile ismodified based on a horizontal travel distance of the aerial vehicleincluding by shifting one or more entries of the relative height profilebased on a magnitude of the horizontal travel distance.
 18. The systemof claim 13, wherein the one or more relative height values included inthe relative height profile are each associated with an indicator ofconfidence of the associated relative height value.
 19. The system ofclaim 1, wherein using the determined vertical difference toautomatically adjust the flight altitude of the aerial vehicle includesselecting the determined vertical difference as a smallest value among agroup of vertical differences associated with a look-forward distance ofthe aerial vehicle.
 20. A method for controlling an aerial vehicle,comprising: measuring a distance from the aerial vehicle to a terrainfeature located forward and lower with respect to the aerial vehicle;detecting a current orientation of the aerial vehicle with respect to areference orientation, wherein the current orientation includes acurrent orientation angle; using at least the measured distance, aforward-downward positioning angle of a distance sensor, and the currentorientation including the current orientation angle detected using amotion sensor to determine a relative vertical difference between avertical location of the aerial vehicle and a vertical location of theterrain feature, including by using the forward-downward positioningangle of the distance sensor together with the current orientation angledetected using the motion sensor to determine a total angle of themeasured distance with respect to a horizontal plane; and using thedetermined vertical difference to automatically adjust a flight altitudeof the aerial vehicle.